<script>
/**
 * 这里将脚本写在前面，因为脚本中可以方便的书写注释
 */
export default {
  	name: 'header',
  	data () {
    	return {
      		articles: [],
      		v1: "hiii"
    	}
  	},
  	mounted: function() {
  		this.$http.jsonp(urlConfig.header, {}, {
  	        headers: {
  	        },
  	        emulateJSON: true
  	    }).then(function(response) {
  	        // 这里是处理正确的回调
  	        this.articles = response.data.subjects
  	        // this.articles = response.data["subjects"] 也可以
  	    }, function(response) {
  	        // 这里是处理错误的回调
  	        console.log(response)
  	    });
  	}
  }
</script>

<template>
<div id="header">
	<p>I am Header!!!</p>
	<p>{{myData}}</p>
	<p>{{v1}}</p>
	<ul>
	    <li v-for="article in articles">
	        {{article.title}}
	    </li>
	</ul>
</div>
</template>

<style lang="scss">
#header {
	font-family: 'Avenir', Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-align: center;
	color: #2c3e50;
	margin-top: 60px;
}
</style>
